<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>expression</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>
<body>
    <div id="app">
        <p>点击了{{counter}}次</p>
        <button v-on:click="counter++">点击加1</button>
        <button v-on:click="greet">传函数名称</button>
        <button v-on:click="say('hi')">内联函数调用</button>
        <button v-on:click="say('hi',$event)">内联函数调用传入事件</button>
    </div>
    <script>
        var app = new Vue({
            el:"#app",
            data:{
                counter:0,
            },
            methods:{
                greet(event){
                    console.log(event);
                },
                say(str,e){
                    console.log("内敛函数调用"+str);
                    console.log(e);
                    console.log(event);
                }
            }

        });
    </script>
</body>
</html>